import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'


import VideoPlayer from 'vue-video-player'
import 'vue-video-player/src/custom-theme.css'
import 'video.js/dist/video-js.css'
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import {
	Message
} from 'element-ui';
import "@/assets/css/init.css"
import "@/assets/css/register.css"
import "@/assets/css/style.css"
import "@/assets/css/payment.css"
import "@/assets/css/animate.css"
import "@/assets/js/uuid4.js"
import tips from "@/components/tips.vue"
import vipCount from "@/components/vipCount.vue"
import calendar from "@/util/index.js"
import SlideVerify from 'vue-monoplasty-slide-verify'


Vue.use(VideoPlayer)
Vue.use(ElementUI);
Vue.component('tips', tips)
Vue.component('vip-count', vipCount)
Vue.use(SlideVerify);
Vue.config.productionTip = false
router.beforeEach((to, from, next) => {
	if (to.meta.requireAuth == true) {
		if (localStorage.getItem("key")) {
			next()
		} else {
			Message.error("请先登录才能继续下面操作,即将跳转到登录页!");
			setTimeout(() => {
				next("/userLogin")
			}, 1000)
		}

	} else {
		next()
	}
})

// router.afterEach((to, from, next) => {
// 	window.scrollTo(10,10)
// });

import ajax from "./api";
Vue.prototype.$ajax = ajax;
Vue.prototype.calendar = calendar
new Vue({
	router,
	store,
	render: h => h(App)
}).$mount('#app')